<template>
	<div class='authen-content'>
		<el-form label-width='90px'
            label-position='left'
            :rules='valiRules'
            :model='valiForm'
            ref='valiForm'
            v-show='status === 1 || status === 3'>
			<h2>认证信息</h2>
            <el-form-item label="公司名" prop='companyName'>
                <el-input placeholder="请确保与营业执照一致" 
                    v-model='valiForm.companyName'></el-input>
            </el-form-item>

            <el-form-item label="地址" prop='address'>
                <el-input placeholder="请确保与营业执照一致"
                    v-model='valiForm.address'></el-input>
            </el-form-item>

            <el-form-item prop='licenceImg' class='img-wrapper'>
                <p class='little-label'>上传工商营业执照原件照片</p>
                <upload @getUrl='onGetLicenceUrl'
                    :img='valiForm.licenceImg'
                    class='left-img'></upload>
            </el-form-item>

            <el-form-item>
                <p class='little-label'>申请人</p>
                <el-radio-group v-model='valiForm.proposerType'>
                    <el-radio :label='0'>法人</el-radio>
                    <el-radio :label='1'>非法人</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="姓名" prop='name'>
                <el-input placeholder="请输入您的姓名"
                    v-model='valiForm.name'></el-input>
            </el-form-item>

            <el-form-item label="身份证号码" prop='cardId'>
                <el-input placeholder="请输入身份证号码"
                    v-model='valiForm.cardId'></el-input>
            </el-form-item>

            <el-row>
                <el-col :span='12'>
                    <el-form-item :rules="[{
                            required: true, message: '请上传申请人身份证原件正反面照片'
                        }]"
                        prop='proposerFrontImg'>
                        <p class='little-label'>申请人身份证原件（正反面）</p>
                        <upload @getUrl='onGetProposerFrontUrl'
                            class='left-img'></upload>
                    </el-form-item>
                </el-col>
                <el-col :span='13'>
                    <el-form-item :rules="[{
                            required: true, message: '请上传申请人身份证原件正反面照片'
                        }]"
                        prop='proposerBackImg'>
                        <upload @getUrl='onGetProposerBackUrl'
                                :img='valiForm.proposerBackImg'
                                style='margin-left:-105px;margin-top:35px;'></upload>
                    </el-form-item>
                </el-col>

                <el-col :span='11'>
                    <el-form-item v-show='valiForm.proposerType===1'
                        prop='unProposerImgUrl'>
                        <p class='little-label'>法人委托书原件</p>
                        <upload @getUrl='onGetUnProposerUrl'
                            :img='valiForm.unProposerImgUrl'
                            class='left-img'
                            ref='child'></upload>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-button type='primary' @click='onRegister("valiForm")'>提交</el-button><el-button @click='onReset("valiForm")'>重置</el-button><el-button @click='logout' style='margin-left:50px;'>退出登录</el-button>
		</el-form>

        <el-dialog title='提示'
            :visible.sync='isAuthenDialogVisible'>
            <span>{{dialogText}}</span>
            <span slot='footer' class='dialog-footer'>
                <el-button @click='onLogout'>退出</el-button>
                <el-button type='primary' @click='isAuthenDialogVisible = false'>确定</el-button>
            </span>
        </el-dialog>
        
        <el-dialog title='提示'
            :visible.sync='isTipDialogVisible'
            :before-close='onDirLogout'>
            <span>{{tipDialogText}}</span>
            <span slot='footer' class='dialog-footer'>
                <el-button type='primary' @click='onDirLogout'>确认</el-button>
            </span>
        </el-dialog>
	</div>
</template>

<script>
	import AuthenJs from './Authen.js';
	module.exports = AuthenJs;
</script>

<style scrope lang='less'>
	@import url('./Authen.less');
</style>